<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/common.css?01_34"/>
		<link rel="stylesheet" type="text/css" href="../css/templet.css?01_34"/>
		<link rel="stylesheet" type="text/css" href="../fonts/font-awesome.min.css?01_34"/>
		<link rel="stylesheet" type="text/css" href="../mui/css/mui.css?01_34"/>
		
		<!--公共js-->
		<script type="text/javascript" src="../common/js/jquery.js?01_34"></script>
		
		<!--插件-->
		<script type="text/javascript" src="../common/js/vue.min.js?01_34"></script>
		<script type="text/javascript" src="../common/js/mui.min.js?01_34"></script>
		
		<script type="text/javascript" src="../common/js/fastclick.js?01_34"></script>
		<script type="text/javascript" src="../common/js/common.js?01_34"></script>
		<script type="text/javascript" src="../common/js/my_common.js?01_34"></script>
		<script type="text/javascript" src="../common/js/main.js?01_34"></script>
		<script type="text/javascript" src="../common/js/app.js?01_34"></script>
	</head>
	<body>
		<div class="wrap_body go_duty" id="app" v-cloak="">
			
			<header class="bg-red9 fff f-20 pad-t-10 pad-b-10 pad-l-10 pad-r-10">
				<div class="pa back" onclick="back();"><a></a></div>
				<div class="center">{{b_lg[1257]}}</div>
			</header>
			<div class="content pad-l-15 pad-r-15 center pad-t-65" >
				<div>
					<div class="top fff pad-t-20">
						<p>
							<img v-if=" obj.shop_info.shop_logo !='' " :src="oss+obj.shop_info.shop_logo" class="icon"/>
							<img v-else :src="con_img" class="icon" onerror="lod(this)"/>
						</p>
						<!--店铺名-->
						<p class="f-20 f-b pad-t-15">{{obj.shop_info.shop_name}}</p>
						<!--店铺地址-->
						<p class="f-15 pad-t-12 pad-l-5 pad-r-5">{{obj.shop_info.shop_address}}</p>
					</div>
					
					<div class="bottom bg-fff">
						<div class=" pad-t-50 pad-b-50">
							<p class="f-30 red9"><span>{{goodmorning}}</span>，<span>{{username}}</span></p>
							<p class="pad-t-35"><span class="f-16">当前时间：</span><span class="f-20 f-b"> {{new Date(obj.time*1000).format("hh：mm：ss")}}</span></p>
							<p class="f-16 pad-t-10"><span>{{new Date(obj.time*1000).format("yyyy年MM月dd日")}} </span><span> {{b_lg[1260].split(',')[new Date(obj.time*1000).getDay()]}}</span></p>
						</div>
						<div><div class="circle fl"></div><div class="circle fr"></div></div>
						<hr />
						<div class="mag-t-20 pad-b-20 page" @click="gowork">
							<p class="go"></p>
							<p class="red9 pad-t-10">上班</p>
						</div>
					</div>
					<div class="page bank5 bg-fff col-sm-11 page_01"></div>
					<div class="page bank5 bg-fff col-sm-10 page_02"></div>
				</div>
			</div>
			
			<div class="bank40"></div>
			
		</div>
	</body>
	<script type="text/javascript">
		var app = null;
		function fun1 () {
			app = new Vue({
				el:"#app",
				data:{
					obj:{},
					username:"",//用户名
					weekend:["星期一","星期二","星期三","星期四","星期五","星期六","星期日"],
					b_lg: global_lange, //语言包
					goodmorning:""
				},
				created:function () {
					this.init();
				},
				methods:{
					init:function () {
						common_ajax (1,{},"get_home",function (res) {//获取店铺信息
							if (res.status == 1) {
								app.obj = res.result;
								console.log(app.obj);
								
								//判断早中晚
								var time = new Date(app.obj.time*1000).format("hh") 
								if (time<5) {
									app.goodmorning = "凌晨好";
								}else if (time<8) {
									app.goodmorning = "早上好";
								}else if (time<12) {
									app.goodmorning = "上午好";
								}else if (time<14) {
									app.goodmorning = "中午好";
								}else if (time<18) {
									app.goodmorning = "下午好";
								}else if (time<23) {
									app.goodmorning = "晚上好";
								}

								common_ajax (1,{},"get_waiter_info",function (res) {//获取用户信息
									if (res.status == 1) {
										app.username = res.result.nickname;
									}else {
										mui.toast(res.msg);
									}
								})
							}else {
								mui.toast(res.msg);
							}
							
						})
					},
					gotoart: function (e) {//跳转地址
						clicked(e);//全局
					},
					//开始上班
					gowork:function () {

						//提示框
						var btnArray2 = [app.b_lg[1049], app.b_lg[1008]];
						mui.confirm(app.b_lg[1264], app.b_lg[1050], btnArray2, function(ee) {
							if (ee.index == 1) {
								//确定
								common_ajax (1,{uuid:phone_uuid},"put_work_sign_scan",function (res) {
									if (res.status == 1) {
										app.gotoart("../work/workbench.html");
									}
								})
							}else{
								//取消
								app.init();
							}
						},"div")
					}
				}
			})
			
		}
	</script>
</html>
